﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace WPGame.BaseObject
{

    //7ung
    abstract class MyDynamicObject : MyObject
    {


        private MoveAbillity m_MoveAbility;
        private DIR m_vDir;

        public MyDynamicObject(eGSprite _sprite, DIR _dir , ID _id, Vector2 position)
            : base(_sprite,_id,position)
        {
            Ability = new MoveAbillity();
            VDir = _dir;
        }


        public MoveAbillity Ability
        {
            get { return m_MoveAbility; }
            set { m_MoveAbility = value; }
        }

        /// <summary>
        /// Hướng nhìn
        /// </summary>
        public DIR VDir
        {
            get{return m_vDir;}
            set{m_vDir = value;}
        }

        public virtual void Move(GameTime gametime)
        {
            if (this.Timer.StopWatch(GGlobalSetting.FPS, gametime))
            {
                Sprite.setFrame();
                this.Sprite.Position += this.Ability.VSpeed * GGlobalSetting.FPS;
            }
        }

        
    }
}
